package com.vint.mi;

import java.util.Arrays;

/**
 * 1. easy,done
 * 2. 找出唯一只出现一次的数，其它的出现两次
 */
public class Mi0 {
	public static String solution(String line) {
		String[] ab = line.split(";");
		String[] abs = ab[0].split(" ");
		int A = Integer.parseInt(abs[0]);
		int B = Integer.parseInt(abs[1]);

		String[] dots = ab[1].split(" ");
		int[] dot = new int[dots.length];
		for (int i=0; i<dot.length; i++) {
			dot[i] = Integer.parseInt(dots[i]);
		}

		Arrays.sort(dot);

		//....

		double sum = 0;
		int first = dot[0];
		double part = A;
		for (int i : dot) {
			double r = (i - first) * 1.0 / 2;
			if (r * B > part) {
				sum += part;
				first = i;
				part = A;
			} else {
				part = A + r * B;
			}
		}


		sum += part;
		return String.format("%.1f", sum);
	}


	public static void main(String[] args) {
		System.out.println(solution("20 5;100 0 7"));
	}

}



